<?php


namespace app\team\controller;

use app\admin\model\AdminUser;
use app\admin\model\TeamSourceModel;
use app\api\model\Token;
use app\common\controller\Api;
use app\common\controller\TeamApi;
use app\common\library\Sms as Smslib;
use app\common\model\ApplyTeamModel;
use app\common\model\CateModel;
use app\common\model\DouyinModel;
use app\common\model\ItemModel;
use app\common\model\SourceModel;
use think\facade\Hook;
use think\facade\Validate;
use think\Request;
use util\Http;

/**
 * @title 授权登陆
 * @controller api\controller\Sms
 * @group base
 */
class Index extends TeamApi
{
    public function getUser(){
        $data = (new AdminUser())->getUser($this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }
    public function getTeamDyItemList()
    {
        $data = (new ItemModel())->getTeamDyItemList($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    public function getAppleTeamCount(){
        $data = (new ApplyTeamModel())->getCount($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }

    public function getTeamList(){
        $data = (new ApplyTeamModel())->getTeamList($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    public function getTeamSource()
    {
        $data = (new TeamSourceModel())->getTeamSource($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    public function addTeamSource(){
        $data = (new TeamSourceModel())->addTeamSource($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }

    public function updateTeamSource(){
        $data = (new TeamSourceModel())->updateTeamSource($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }

    public function deleteTeamSource(){
        $data = (new TeamSourceModel())->deleteTeamSource($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }

    public function statusTeamSource(){
        $data = (new TeamSourceModel())->statusTeamSource($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }

    public function refuseTeam(){
        $data = (new ApplyTeamModel())->refuseTeam($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }

    public function agreeTeam(){
        $data = (new ApplyTeamModel())->agreeTeam($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    //修改密码
    public function updatePassword(){
        $data = (new ApplyTeamModel())->updatePassword($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }


    //移除团队
    public function removeStaff(){
        $data = (new ApplyTeamModel())->removeStaff($this->request_array,$this->aid);
        $data['code'] == 200 ? $this->success($data['msg'], $data['data']) : $this->error($data['msg']);
    }









}